using CodeSaude.Domain.Entities;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace CodeSaude.Infrastructure.Data.EntityConfig
{
    public class etniaMap : EntityTypeConfiguration<etnia>
    {
        public etniaMap()
        {
            // Primary Key
            this.HasKey(t => t.id_etnia);

            // Properties
            this.Property(t => t.nome_etnia)
                .IsRequired()
                .HasMaxLength(60);

            // Table & Column Mappings
            this.ToTable("etnia");
            this.Property(t => t.id_etnia).HasColumnName("id_etnia");
            this.Property(t => t.nome_etnia).HasColumnName("nome_etnia");
        }
    }
}
